package com.thinking.exersises;

import java.util.Random;

/**
 * Created by IntelliJ IDEA.
 * User: pvg
 * Date: 11/1/11
 * Time: 6:17 PM
 Write a program that generates 25 random int values. For each value,
 use an if-else statement to classify it as greater than,
 less than, or equal to a second randomly generated value.
 */
public class Exersise2page96 {
    public static void compareRandomValues(int valueCount, int randomInterval) {
        Random r = new Random();
        int current = r.nextInt(randomInterval);
        for (int i = 0; i < valueCount; i++) {
            int next = r.nextInt(randomInterval);
          if (current == next) {
              System.out.println(current + " " + next + " " + "equals");
          }
          if (current > next) {
              System.out.println(current + " " + next + " " + "moar");
          }
          if (current < next ) {
              System.out.println(current + " " + next + " " + "less");
          }
        current = next;
        }


    }

    public static void main(String[] args) {
        compareRandomValues(25, 100);
    }
}
